﻿			public function animar()
			{
				var animacion:Tween = new Tween(this,"x",Elastic.easeOut,-100,0,1,true);
			}

			public function onSwipe(e:TransformGestureEvent):void
			{
				if (e.offsetX == 1 && currentFrame > 1)
				{
					//User swiped towards right
					prevFrame();
				}
				if (e.offsetX == -1 && currentFrame || 0)
				{
					//User swiped towards left
					nextFrame();
				}
			}
			
			public function pushUp(msg:String)
			{
				var mc:MovieClip = new MovieClip();
				var mensaje:TextField = new TextField();
				var myFormat = new TextFormat("Futura");
				myFormat.align = TextFormatAlign.CENTER;
				myFormat.size = 20;
				mensaje.selectable = false;
				mensaje.wordWrap = true;
				mensaje.defaultTextFormat = myFormat;

				mc.graphics.beginFill(0x3399FF);
				mc.graphics.drawRect(0, 0, stage.stageWidth, 50);
				mc.graphics.endFill();
				mc.x = 0;
				mc.y = 0;

				mensaje.width = stage.stageWidth;
				mensaje.y = 10;
				mensaje.x = 0;
				mensaje.text = msg;
				mensaje.textColor = 0xFFFFFF;

				addChild(mc);
				mc.addChild(mensaje);
				animarPush(mc);
			}

			public function animarPush(objeto:MovieClip)
			{
				var aparecer:Tween = new Tween(objeto,"alpha",Strong.easeIn,0,1,0.7,true);
				var delayer:Timer = new Timer(5000,1);
				delayer.addEventListener(TimerEvent.TIMER, timerListener);
				function timerListener(e:TimerEvent):void
				{
					var desaparecer:Tween = new Tween(objeto,"alpha",Strong.easeIn,1,0,0.7,true);
					var delayer2:Timer = new Timer(5000,1);
					delayer2.addEventListener(TimerEvent.TIMER, timerListener2);
					function timerListener2(TimerEvent):void{
						removeChild(objeto);
					}
					delayer2.start();
				}
				delayer.start();
			}
